
/*!
    Copyright (C) 1991-2012 johnxguo GX.
    This file is a part of the "Heaven Engine".
*/

#ifndef __HEA_COMPILE_CFG_H_INCLUDED__
#define __HEA_COMPILE_CFG_H_INCLUDED__

#include "gx_include.h"

//! Heaven Engine version : 1.0.0
#define HEAVEN_VERSION_MAJOR 1
#define HEAVEN_VERSION_MINOR 0
#define HEAVEN_VERSION_REVISION 0
#define HEAVEN_SDK_VERSION "1.0.0"

//! Visual Studio version must be 7.0 or later.(if used)
#if defined(_MSC_VER) && (_MSC_VER < 1300)
#   error "Only Microsoft Visual Studio 7.0 and later are supported."
#endif

#include <stdio.h> 

//! Fallback console device.
#define _HEA_COMPILE_WITH_CONSOLE_DEVICE_

//! Fallback SDL device.
//#define _HEA_COMPILE_WITH_SDL_DEVICE_

//! _HEA_XBOX_PLATFORM_                  : XBox
//! _HEA_WINDOWS_                        : all Heaven supported Windows versions
//! _HEA_WINDOWS_CE_PLATFORM_            : Windows CE
//! _HEA_WINDOWS_API_                    : Windows or XBox
//! _HEA_LINUX_PLATFORM_                 : Linux (it is defined here if no other os is defined)
//! _HEA_SOLARIS_PLATFORM_               : Solaris
//! _HEA_OSX_PLATFORM_                   : Apple systems running OSX
//! _HEA_POSIX_API_                      : Posix compatible systems

//! _HEA_COMPILE_WITH_WINDOWS_DEVICE_    : Windows API based device
//! _HEA_COMPILE_WITH_WINDOWS_CE_DEVICE_ : Windows CE API based device
//! _HEA_COMPILE_WITH_OSX_DEVICE_        : Cocoa native windowing on OSX
//! _HEA_COMPILE_WITH_X11_DEVICE_        : Linux X11 based device
//! _HEA_COMPILE_WITH_SDL_DEVICE_        : platform independent SDL framework
//! _HEA_COMPILE_WITH_CONSOLE_DEVICE_    : no windowing system, used as a fallback
//! _HEA_COMPILE_WITH_FB_DEVICE_         : framebuffer systems

//! ALL Windows Platform.
#if defined(_GX_WINDOWS_)
#define _HEA_WINDOWS_
#define _HEA_WINDOWS_API_
#define _HEA_COMPILE_WITH_WINDOWS_DEVICE_
#endif

//! WINCE.
#if defined(_WIN32_WCE)
#define _HEA_WINDOWS_
#define _HEA_WINDOWS_API_
#define _HEA_WINDOWS_CE_PLATFORM_
#define _HEA_COMPILE_WITH_WINDOWS_CE_DEVICE_
#endif

//! XBox.
#if defined(_XBOX)
#undef  _HEA_WINDOWS_
#undef  _HEA_COMPILE_WITH_WINDOWS_DEVICE_
#define _HEA_XBOX_PLATFORM_
#define _HEA_WINDOWS_API_
#include <xtl.h>
#endif

//! APPLE.
#if defined(__APPLE__) || defined(MACOSX)
#if !defined(MACOSX)
#define MACOSX
#endif
#define _HEA_OSX_PLATFORM_
#define _HEA_COMPILE_WITH_OSX_DEVICE_
#endif

//! Other platform is linux for default.
#if !defined(_HEA_WINDOWS_API_) && !defined(_HEA_OSX_PLATFORM_)
#ifndef _HEA_SOLARIS_PLATFORM_
#define _HEA_LINUX_PLATFORM_
#endif
#define _HEA_POSIX_API_
#define _HEA_COMPILE_WITH_X11_DEVICE_
#endif

//! Joystick events support.
//#define _HEA_COMPILE_WITH_JOYSTICK_EVENTS_

//! Maximum textures the smaterial can have, heaven can support 8 at most.
#define _HEA_MATERIAL_MAX_TEXTURES_ 4

//! Used d3d to compile.
#if defined(_HEA_WINDOWS_API_) && (!defined(__GNUC__) || defined(HEA_COMPILE_WITH_DX9_DEV_PACK))
//#define _HEA_COMPILE_WITH_DIRECT3D_8_
#define _HEA_COMPILE_WITH_DIRECT3D_9_
#endif

//! Other graphics api.
#define _HEA_COMPILE_WITH_OPENGL_
#define _HEA_COMPILE_WITH_SOFTWARE_
#define _HEA_COMPILE_WITH_BURNINGSVIDEO_
#define _HEA_COMPILE_WITH_X11_

//! OpenGL extensions via function pointers is not supported on some platforms.
#if !defined(_HEA_OSX_PLATFORM_) && !defined(_HEA_SOLARIS_PLATFORM_)
#define _HEA_OPENGL_USE_EXTPOINTER_
#endif

#if defined(_HEA_LINUX_PLATFORM_) && defined(_HEA_COMPILE_WITH_X11_)
#define _HEA_LINUX_X11_VIDMODE_
//#define _HEA_LINUX_X11_RANDR_
#endif

//! Use built-in GUI.
#define _HEA_COMPILE_WITH_GUI_

//! Unicode filesystem support.
//#define _HEA_WCHAR_FILESYSTEM

//! Enable Heaven to read jpeg file.(both sys or jpeglib) 
#define _HEA_COMPILE_WITH_LIBJPEG_

//! Use jpeglib to read jpeg file for default other than sys.
#define _HEA_USE_NON_SYSTEM_JPEG_LIB_

//! Enable Heaven to read png file.(both sys or jpeglib) 
#define _HEA_COMPILE_WITH_LIBPNG_

//! Use jpeglib to read png file for default other than sys.
#define _HEA_USE_NON_SYSTEM_LIB_PNG_

//! Disable shader debugging in D3D9.
#define _HEA_D3D_NO_SHADER_DEBUGGING

//! Enable the old HLSL compiler in recent DX SDKs.
//#define _HEA_D3D_USE_LEGACY_HLSL_COMPILER

//! Use the nVidia PerHUD tool.
#undef _HEA_USE_NVIDIA_PERFHUD_

//! Define one of the three setting for Burning's Video Software Rasterizer.
#define BURNINGVIDEO_RENDERER_BEAUTIFUL
//#define BURNINGVIDEO_RENDERER_FAST
//#define BURNINGVIDEO_RENDERER_ULTRA_FAST
//#define BURNINGVIDEO_RENDERER_CE

//! Ignore the deprecated warnings.
//#define IGNORE_DEPRECATED_WARNING

//! Use skinned mesh.
#define _HEA_COMPILE_WITH_SKINNED_MESH_SUPPORT_

#ifdef _HEA_COMPILE_WITH_SKINNED_MESH_SUPPORT_
#define _HEA_COMPILE_WITH_B3D_LOADER_
#define _HEA_COMPILE_WITH_MS3D_LOADER_
#define _HEA_COMPILE_WITH_X_LOADER_
#define _HEA_COMPILE_WITH_OGRE_LOADER_
#endif

//! Load .heamesh files.
#define _HEA_COMPILE_WITH_HEA_MESH_LOADER_

//! Load Quake 2 animated files
#define _HEA_COMPILE_WITH_MD2_LOADER_
//! Load Quake 3 animated files
#define _HEA_COMPILE_WITH_MD3_LOADER_

//! Load 3D Studio Max files
#define _HEA_COMPILE_WITH_3DS_LOADER_
//! Load Collada files
#define _HEA_COMPILE_WITH_COLLADA_LOADER_
//! Load Cartography Shop files
#define _HEA_COMPILE_WITH_CSM_LOADER_
//! Load Quake 3 BSP files
#define _HEA_COMPILE_WITH_BSP_LOADER_
//! Load DeleD files
#define _HEA_COMPILE_WITH_DMF_LOADER_
//! Load LMTools files
#define _HEA_COMPILE_WITH_LMTS_LOADER_
//! Load MY3D files
#define _HEA_COMPILE_WITH_MY3D_LOADER_
//! Load Wavefront OBJ files
#define _HEA_COMPILE_WITH_OBJ_LOADER_
//! Load FSRad OCT files
#define _HEA_COMPILE_WITH_OCT_LOADER_
//! Load Lightwave3D files
#define _HEA_COMPILE_WITH_LWO_LOADER_
//! Load stereolithography files
#define _HEA_COMPILE_WITH_STL_LOADER_
//! Load Polygon (Stanford Triangle) files
#define _HEA_COMPILE_WITH_PLY_LOADER_

//! Write .heamesh files
#define _HEA_COMPILE_WITH_HEA_WRITER_
//! Write Collada files
#define _HEA_COMPILE_WITH_COLLADA_WRITER_
//! Write .stl files
#define _HEA_COMPILE_WITH_STL_WRITER_
//! Write .obj files
#define _HEA_COMPILE_WITH_OBJ_WRITER_
//! Write .ply files
#define _HEA_COMPILE_WITH_PLY_WRITER_

//! Load .bmp files.
#define _HEA_COMPILE_WITH_BMP_LOADER_
//! Load .jpg files
#define _HEA_COMPILE_WITH_JPG_LOADER_
//! Load .pcx files
#define _HEA_COMPILE_WITH_PCX_LOADER_
//! Load .png files
#define _HEA_COMPILE_WITH_PNG_LOADER_
//! Load .ppm/.pgm/.pbm files
#define _HEA_COMPILE_WITH_PPM_LOADER_
//! Load .psd files
#define _HEA_COMPILE_WITH_PSD_LOADER_
//! Load .tga files
#define _HEA_COMPILE_WITH_TGA_LOADER_
//! Load .wal files
#define _HEA_COMPILE_WITH_WAL_LOADER_
//! Load .rgb/.rgba/.sgi/.int/.inta/.bw files
#define _HEA_COMPILE_WITH_RGB_LOADER_

//! Write .bmp files
#define _HEA_COMPILE_WITH_BMP_WRITER_
//! Write .jpg files
#define _HEA_COMPILE_WITH_JPG_WRITER_
//! Write .pcx files
#define _HEA_COMPILE_WITH_PCX_WRITER_
//! Write .png files
#define _HEA_COMPILE_WITH_PNG_WRITER_
//! Write .ppm files
#define _HEA_COMPILE_WITH_PPM_WRITER_
//! Write .psd files
#define _HEA_COMPILE_WITH_PSD_WRITER_
//! Write .tga files
#define _HEA_COMPILE_WITH_TGA_WRITER_

//! Load ZIP and GZIP archives
#define __HEA_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
#ifdef __HEA_COMPILE_WITH_ZIP_ARCHIVE_LOADER_

//! Enable zlib
#define _HEA_COMPILE_WITH_ZLIB_
//! Use built-in zlib for default.
#define _HEA_USE_NON_SYSTEM_ZLIB_
//! Read AES-encrypted ZIP archives
#define _HEA_COMPILE_WITH_ZIP_ENCRYPTION_
//! Support bzip2 compressed zip archives
#define _HEA_COMPILE_WITH_BZIP2_
//! Use built-in bzlib
#define _HEA_USE_NON_SYSTEM_BZLIB_
//! Use LZMA compressed zip files.
#define _HEA_COMPILE_WITH_LZMA_
#endif

//! Mount folders as archives
#define __HEA_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
//! Open ID software PAK archives
#define __HEA_COMPILE_WITH_PAK_ARCHIVE_LOADER_
//! Open Nebula Device NPK archives
#define __HEA_COMPILE_WITH_NPK_ARCHIVE_LOADER_
//! Open TAR archives
#define __HEA_COMPILE_WITH_TAR_ARCHIVE_LOADER_

//! Set FPU settings
#if !defined(_HEA_OSX_PLATFORM_) && !defined(_HEA_SOLARIS_PLATFORM_)
	//#define HEAVEN_FAST_MATH
#endif

// Some cleanup and standard stuff

#ifdef _HEA_WINDOWS_API_

#ifndef _HEA_STATIC_LIB_
#ifdef HEAVEN_EXPORTS
#define HEAVEN_API __declspec(dllexport)
#else
#define HEAVEN_API __declspec(dllimport)
#endif // HEAVEN_EXPORT
#else
#define HEAVEN_API
#endif // _HEA_STATIC_LIB_

// Declare the calling convention.
#if defined(_STDCALL_SUPPORTED)
#define HEACALLCONV __stdcall
#else
#define HEACALLCONV __cdecl
#endif // STDCALL_SUPPORTED

#else // _HEA_WINDOWS_API_

// Force symbol export in shared libraries built with gcc.
#if (__GNUC__ >= 4) && !defined(_HEA_STATIC_LIB_) && defined(HEAVEN_EXPORTS)
#define HEAVEN_API __attribute__ ((visibility("default")))
#else
#define HEAVEN_API
#endif

#define HEACALLCONV

#endif // _HEA_WINDOWS_API_

#ifdef _MSC_VER
#if (_MSC_VER < 1300 && !defined(__GNUC__))
#undef _HEA_COMPILE_WITH_DIRECT3D_9_
#pragma message("Compiling Heaven with Visual Studio 6.0, support for DX9 is disabled.")
#endif
#endif

// XBox does not have OpenGL or DirectX9
#if defined(_HEA_XBOX_PLATFORM_)
	#undef _HEA_COMPILE_WITH_OPENGL_
	#undef _HEA_COMPILE_WITH_DIRECT3D_9_
#endif

//! WinCE does not have OpenGL or DirectX9. use minimal loaders
#if defined(_WIN32_WCE)
	#undef _HEA_COMPILE_WITH_OPENGL_
	#undef _HEA_COMPILE_WITH_DIRECT3D_8_
	#undef _HEA_COMPILE_WITH_DIRECT3D_9_

	#undef BURNINGVIDEO_RENDERER_BEAUTIFUL
	#undef BURNINGVIDEO_RENDERER_FAST
	#undef BURNINGVIDEO_RENDERER_ULTRA_FAST
	#define BURNINGVIDEO_RENDERER_CE

	#undef _HEA_COMPILE_WITH_WINDOWS_DEVICE_
	#define _HEA_COMPILE_WITH_WINDOWS_CE_DEVICE_
	//#define _HEA_WCHAR_FILESYSTEM

	#undef _HEA_COMPILE_WITH_HEA_MESH_LOADER_
	//#undef _HEA_COMPILE_WITH_MD2_LOADER_
	#undef _HEA_COMPILE_WITH_MD3_LOADER_
	#undef _HEA_COMPILE_WITH_3DS_LOADER_
	#undef _HEA_COMPILE_WITH_COLLADA_LOADER_
	#undef _HEA_COMPILE_WITH_CSM_LOADER_
	#undef _HEA_COMPILE_WITH_BSP_LOADER_
	#undef _HEA_COMPILE_WITH_DMF_LOADER_
	#undef _HEA_COMPILE_WITH_LMTS_LOADER_
	#undef _HEA_COMPILE_WITH_MY3D_LOADER_
	#undef _HEA_COMPILE_WITH_OBJ_LOADER_
	#undef _HEA_COMPILE_WITH_OCT_LOADER_
	#undef _HEA_COMPILE_WITH_OGRE_LOADER_
	#undef _HEA_COMPILE_WITH_LWO_LOADER_
	#undef _HEA_COMPILE_WITH_STL_LOADER_
	#undef _HEA_COMPILE_WITH_HEA_WRITER_
	#undef _HEA_COMPILE_WITH_COLLADA_WRITER_
	#undef _HEA_COMPILE_WITH_STL_WRITER_
	#undef _HEA_COMPILE_WITH_OBJ_WRITER_
	//#undef _HEA_COMPILE_WITH_BMP_LOADER_
	//#undef _HEA_COMPILE_WITH_JPG_LOADER_
	#undef _HEA_COMPILE_WITH_PCX_LOADER_
	//#undef _HEA_COMPILE_WITH_PNG_LOADER_
	#undef _HEA_COMPILE_WITH_PPM_LOADER_
	#undef _HEA_COMPILE_WITH_PSD_LOADER_
	//#undef _HEA_COMPILE_WITH_TGA_LOADER_
	#undef _HEA_COMPILE_WITH_WAL_LOADER_
	#undef _HEA_COMPILE_WITH_BMP_WRITER_
	#undef _HEA_COMPILE_WITH_JPG_WRITER_
	#undef _HEA_COMPILE_WITH_PCX_WRITER_
	#undef _HEA_COMPILE_WITH_PNG_WRITER_
	#undef _HEA_COMPILE_WITH_PPM_WRITER_
	#undef _HEA_COMPILE_WITH_PSD_WRITER_
	#undef _HEA_COMPILE_WITH_TGA_WRITER_
#endif

#ifndef _HEA_WINDOWS_API_
	#undef _HEA_WCHAR_FILESYSTEM
#endif

#if defined(__sparc__) || defined(__sun__)
#define __BIG_ENDIAN__
#endif

#if defined(_HEA_SOLARIS_PLATFORM_)
	#undef _HEA_COMPILE_WITH_JOYSTICK_EVENTS_
#endif

//#define HEA_FAST_CHECK

#endif // __HEA_COMPILE_CONFIG_H_INCLUDED__

